package com.um.jdy.app.activity.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.um.jdy.app.activity.entity.dto.CouponsGoodsPageDTO;
import com.um.jdy.app.activity.manager.CouponsGoodsManager;
import com.um.jdy.app.activity.manager.CouponsStationManager;
import com.um.jdy.app.device.entity.vo.StationItemVO;
import com.um.jdy.app.shop.entity.vo.GoodsItemVO;
import com.um.springboot.starter.entity.Page;
import com.um.springboot.starter.orm.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 控制器：优惠券站场关联表
 */
@RestController
@RequestMapping("/api/v1/coupons/goods")
@Api(tags = "商品优惠券")
@SaCheckLogin
public class CouponsGoodsController {

    @Autowired
    CouponsGoodsManager couponsGoodsManager;

    /**
     * 分页查询优惠券可用商品
     * @param dto
     * @return
     */
    @ApiOperation("分页查询优惠券可用商品")
    @PostMapping("available")
    public Response<Page<GoodsItemVO>> getGoodsPage(@Valid @RequestBody CouponsGoodsPageDTO dto){
        return Response.success(couponsGoodsManager.getGoodsPage(dto));
    }


}
